﻿using System.ComponentModel.DataAnnotations;

namespace OneDollarStore.Models
{
    public class ContactModel
    {
        [Required(ErrorMessage="Please enter your name")]
        public string Name { get; set; }

        [Required(ErrorMessage="Please enter your email address")] 
        // A valid email is an email that contains symbol @ and .
        // *@*.* (* <=> .+)
        [RegularExpression(".+\\@.+\\..+", ErrorMessage="Please enter a valid email address")]
        public string Email { get; set; }

        [Required(ErrorMessage = "Please enter email title")]
        public string Title { get; set; }

        [Required(ErrorMessage = "Please enter email content")]
        public string Content { get; set; }
    }
}